package cn.anecansaitin.whimsy.common.attachment;

import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.item.ItemStack;
import net.neoforged.neoforge.common.util.INBTSerializable;

public class ItemStackData implements INBTSerializable<CompoundTag> {
    public ItemStack itemStack;

    public ItemStackData(ItemStack itemStack) {
        this.itemStack = itemStack;
    }

    @Override
    public CompoundTag serializeNBT() {
        return itemStack.save(new CompoundTag());
    }

    @Override
    public void deserializeNBT(CompoundTag nbt) {
        itemStack = ItemStack.of(nbt);
    }
}
